WDV321 Advanced JavaScript

Dynamic Content - Drop Down Lists

The goals of this assignment:

  1. Demonstrate how to dynamically populate a select element using the document.write() technique
  2. Demonstrate how to dynamically populate a select element using the createElement() technique
  3. Demonstrate how to dynamically add an option to a select element
  4. Demonstrate how to dynamically change the options of a select element

Team Names

Team Name:

Instructions:

  1. Use document.write() and the teamNames array to populate the teamNames select element.
  2. When a team is selected display the selected name next to 'Team Name:'' on the page.
  3. When the Add Team Name button is clicked add the name entered in the textfield to the teamNames select element.
  4. The reset button should reset the fields to their original values.

Cookies or Candy?

Selected Product:


Instructions:

  1. Use the createElement() technique and the cookies array to populate the productDisplay select element.
  2. When a product is selected is selected, display the selected name next to 'Selected Product:'' on the page.
  3. Change the contents of the productDisplay based on which radio button is selected.
  4. The reset button should reset the fields to their original values.